package com.topup.mapper;

import java.util.List;

import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import com.topup.pojo.Student;

public interface StudentMapper {
	
	@Insert("insert into tb_stu(name,classes,department,email,phone)  VALUES(#{name},#{classes},#{department},#{email},#{phone})")
	public int addOne(Student s);
	
	
	@Select("SELECT * FROM tb_stu WHERE name = #{name} and department = #{department}")
	public Student selectStu(Student stu);
	
	
	@Update("UPDATE tb_stu SET stunum =#{stunum},name=#{name},sex=#{sex},classes=#{classes},department=#{department},email=#{email},phone=#{phone} WHERE id = #{id}\r\n" + 
			"")
	public int update (Student student);
	
	@Select("SELECT * from tb_stu")
	public List<Student> selecta();
	
	
	@Update("UPDATE tb_stu SET  stu_money =#{money} WHERE id = #{stuid}\r\n" + 
			"")
	public int updateMoney(@Param("stuid")int stuid,@Param("money")String money);
	
	
	
}
